from django.contrib import admin
from .models import LeaveLog


# Register your models here.


@admin.register(LeaveLog)
class LeaveLogAdmin(admin.ModelAdmin):
    list_display = (
        'classname', 'name', 'phone', 'go_place', 'description', 'status', 'rejection', 'operator', 'create_time',
        'return_time')
    list_editable = ('status', 'rejection',)
    search_fields = ('classname', 'name', 'phone')
    list_filter = ('status', 'classname')
    list_per_page = 50

    # def mark_done(self, request, queryset):
    #     for i in queryset:
    #         cla = LeaveLog.models.Class.objects.get(classname=i.classname)
    #         student = info.models.Student.objects.get(name=i.name, cla=cla)
    #         act = Activity.objects.get(name=i.act_name)
    #         ActLog.objects.create(student=student, activity=act)
    #
    # mark_done.short_description = '标记已完成'
